package com.lrkj.back.service.impl;

import java.util.List;
import java.util.Map;

import com.lrkj.back.entity.ZsCangku;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.lrkj.back.mapper.ZsCangkuMapper;
import com.lrkj.back.service.ZsCangkuService;
import cn.com.cbons.mamisay.parent.db.api.DBInterface;
import cn.com.cbons.mamisay.parent.exception.DBException;
import cn.com.cbons.mamisay.parent.service.base.ParentServiceImpl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;

@Transactional
@Service
public class ZsCangkuServiceImpl extends ParentServiceImpl<ZsCangku> implements ZsCangkuService {

    @Autowired
    private ZsCangkuMapper cangkuMapper;

    @Override
    public PageInfo<ZsCangku> findAllCangku(Map<String, Object> map) throws DBException {
        PageHelper.startPage(Integer.valueOf(map.get("pageNo").toString()),
                Integer.valueOf(map.get("pageSize").toString()));
        List<ZsCangku> tbList = cangkuMapper.findAllCangku(map);
        PageInfo<ZsCangku> page = new PageInfo<ZsCangku>(tbList);
        return page;
    }

    @Override
    public List<ZsCangku> findlist() {
        return  cangkuMapper.findlist();
    }

    // 返回一个mapper对象
    @Override
    protected DBInterface<ZsCangku> getDao() throws DBException {
        // TODO Auto-generated method stub
        return cangkuMapper;
    }

}
